Page({
  goLogin () {
    wx.navigateTo({
      url: '/pages/login/index'
    })
  },
  data: {
    userInfo: {},
    isLogin: false
  },
  onShow () {
    const token = wx.getStorageSync('token')
    if (token) {
      this.getUserInfo()
    }
  },
  async getUserInfo () {
    const { data } = await wx.http.get('/userInfo')
    this.setData({ userInfo: data })
    console.log(this.data.userInfo)
  }
})
